package com.lj.domain;

/**
 * Created by dave_suwei on 2017/12/7.
 */
public class SimpleResponse implements IDomain{
    private boolean ok;
    private String msg;
    private IDomain entry;

    public boolean isOk() {
        return ok;
    }

    public void setOk(boolean ok) {
        this.ok = ok;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public IDomain getEntry() {
        return entry;
    }

    public void setEntry(IDomain entry) {
        this.entry = entry;
    }

    @Override
    public String toJson(){
        if(entry!=null) {
            return "{'ok':" + ok + ",'msg':'" + msg + "','entry':" + entry.toJson() + "}";
        }else{
            return "{'ok':" + ok + ",'msg':'" + msg + "'}";
        }
    }

    @Override
    public String toString() {
        return "SimpleResponse{" +
                "ok=" + ok +
                ", msg='" + msg + '\'' +
                '}';
    }
}
